package controller;

import project_package.*;

public class RentController 
{

	private RentRecords rentRecordsCtrl;
	private RentHistory rentHistoryCtrl;
	private static RentController instance = null;
	
	public static RentController getInstance()
    {
    	if(instance == null)
    	{
    		instance = new RentController();
    	}
    	return instance;
    }
	
	
	
	public RentController() 
	{
        rentRecordsCtrl = RentRecords.getInstance(); 
        rentHistoryCtrl = RentHistory.getInstance();        
	}

	public void createRent(String name, double price, Customer customer, Employee employee)
	{
		rentRecordsCtrl.createRent(name, price, customer, employee);
	}
		
	public void leaseRent(Rent rent, Customer customer, Employee employee, long leasePeriod) 
	{
		rentRecordsCtrl.leaseRent(rent, customer, employee, leasePeriod);
	}
	
	public void addRent(Rent rent)
	{
		rentRecordsCtrl.addRent(rent);
	}
	
	public void deleteRent(int id)
	{
		rentRecordsCtrl.deleteRent(id);		
	}
	
	public void returnRent(Rent rent)
	{
		rentRecordsCtrl.returnRent(rent);
	}
	
	public Rent findRentID(int id) 
	{
		return rentRecordsCtrl.findRentID(id);
	}
	
	public Rent findRentName(String name)
	{
		return rentRecordsCtrl.findRentName(name);
	}
	
	public void printRents()
	{
		rentRecordsCtrl.printRents();
	}
	
	public void printRent(int id)
	{
		rentRecordsCtrl.printRent(id);
	}
	
	public void printRentsAvailable() 
	{
		rentRecordsCtrl.printRentsAvailable();
	}
	
	public String[][] getHistory()
	{
		return rentHistoryCtrl.getHistory();
	}
}